<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tvs_sdk_api: tvs_media_player_adapter.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tvs_sdk_api
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('tvs__media__player__adapter_8h.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">结构体</a> &#124;
<a href="#define-members">宏定义</a> &#124;
<a href="#typedef-members">类型定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">tvs_media_player_adapter.h 文件参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>TVS 流媒体播放适配接口层  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
tvs_media_player_adapter.h 的引用(Include)关系图:</div>
<div class="dyncontent">
<div class="center"><img src="tvs__media__player__adapter_8h__incl.png" border="0" usemap="#tvs__media__player__adapter_8h" alt=""/></div>
</div>
</div><div class="textblock"><div class="dynheader">
此图展示该文件直接或间接的被哪些文件引用了:</div>
<div class="dyncontent">
<div class="center"><img src="tvs__media__player__adapter_8h__dep__incl.png" border="0" usemap="#tvs__media__player__adapter_8hdep" alt=""/></div>
</div>
</div>
<p><a href="tvs__media__player__adapter_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
结构体</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtvs__mediaplayer__adapter.html">tvs_mediaplayer_adapter</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:a218adff2f290ebce2708b619f9103e2a"><td class="memItemLeft" align="right" valign="top"><a id="a218adff2f290ebce2708b619f9103e2a"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a218adff2f290ebce2708b619f9103e2a">TVS_MEDIA_PLAYER_ERROR_MANNUAL</a>&#160;&#160;&#160;0</td></tr>
<tr class="memdesc:a218adff2f290ebce2708b619f9103e2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">手动停止播放 <br /></td></tr>
<tr class="separator:a218adff2f290ebce2708b619f9103e2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d7717c7c9b9e67c23f4f7968369c802"><td class="memItemLeft" align="right" valign="top"><a id="a1d7717c7c9b9e67c23f4f7968369c802"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a1d7717c7c9b9e67c23f4f7968369c802">TVS_MEDIA_PLAYER_ERROR_OTHER</a>&#160;&#160;&#160;-1</td></tr>
<tr class="memdesc:a1d7717c7c9b9e67c23f4f7968369c802"><td class="mdescLeft">&#160;</td><td class="mdescRight">播放出错 <br /></td></tr>
<tr class="separator:a1d7717c7c9b9e67c23f4f7968369c802"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
类型定义</h2></td></tr>
<tr class="memitem:a9867087019c4f62eea0194df0a248eaf"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a9867087019c4f62eea0194df0a248eaf">tvs_mediaplayer_adapter_set_source</a>) (const char *song_url, const char *token, uint32_t offsetInSeconds)</td></tr>
<tr class="separator:a9867087019c4f62eea0194df0a248eaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1dd54fea0aa69746845bc6132ff367a4"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a1dd54fea0aa69746845bc6132ff367a4">tvs_mediaplayer_adapter_start_play</a>) (const char *token)</td></tr>
<tr class="memdesc:a1dd54fea0aa69746845bc6132ff367a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">开始播放 当云端下发了一个新媒体后，SDK将调用此接口。 需要实现此接口，调用平台的播放器，播放之前set_source阶段下发的媒体url  <a href="#a1dd54fea0aa69746845bc6132ff367a4">更多...</a><br /></td></tr>
<tr class="separator:a1dd54fea0aa69746845bc6132ff367a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeff4493ad02ff9366ed821122b6b588b"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#aeff4493ad02ff9366ed821122b6b588b">tvs_mediaplayer_adapter_stop_play</a>) (const char *token)</td></tr>
<tr class="memdesc:aeff4493ad02ff9366ed821122b6b588b"><td class="mdescLeft">&#160;</td><td class="mdescRight">停止播放 当用户通过语音暂停/停止播放（比如通过语音输入“暂停播放”、“停止播放”等指令）， 或者在APP端暂停/停止播放之前下发的媒体的时候，SDK将会调用此接口。 实现此接口，调用平台播放器的stop功能，停止播放之前下发的流媒体  <a href="#aeff4493ad02ff9366ed821122b6b588b">更多...</a><br /></td></tr>
<tr class="separator:aeff4493ad02ff9366ed821122b6b588b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b66feb55fe6e4b77791adfb7b7cee0a"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a9b66feb55fe6e4b77791adfb7b7cee0a">tvs_mediaplayer_adapter_resume_play</a>) (const char *token)</td></tr>
<tr class="memdesc:a9b66feb55fe6e4b77791adfb7b7cee0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">继续播放 在终端SDK从繁忙状态进入空闲状态后（比如当前一轮智能语音交互、媒体播控等工作结束），SDK将回调此接口， 继续播放之前下发的流媒体；如果之前终端并未处于播放网络流媒体的状态，则SDK不会回调此接口。 实现此接口，调用平台播放器的resume功能  <a href="#a9b66feb55fe6e4b77791adfb7b7cee0a">更多...</a><br /></td></tr>
<tr class="separator:a9b66feb55fe6e4b77791adfb7b7cee0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6884e0117cd98dce6be3882426f9cc7"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#af6884e0117cd98dce6be3882426f9cc7">tvs_mediaplayer_adapter_pause_play</a>) (const char *token)</td></tr>
<tr class="memdesc:af6884e0117cd98dce6be3882426f9cc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">暂停播放 在终端SDK进入繁忙状态（比如开始输入语音、开始媒体播控等情况下），SDK将回调此接口， 暂停当前播放的流媒体。 实现此接口，调用平台播放器的pause功能，暂停播放当前流媒体，以让出资源供SDK执行对应工作  <a href="#af6884e0117cd98dce6be3882426f9cc7">更多...</a><br /></td></tr>
<tr class="separator:af6884e0117cd98dce6be3882426f9cc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52e20f052ba7d319e1fe54e32d14453d"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a52e20f052ba7d319e1fe54e32d14453d">tvs_mediaplayer_adapter_get_offset</a>) (const char *token)</td></tr>
<tr class="memdesc:a52e20f052ba7d319e1fe54e32d14453d"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前播放的网络流媒体的已播放时间  <a href="#a52e20f052ba7d319e1fe54e32d14453d">更多...</a><br /></td></tr>
<tr class="separator:a52e20f052ba7d319e1fe54e32d14453d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f3836b704c2f35f72e4f2d566f40040"><td class="memItemLeft" align="right" valign="top">typedef bool(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a9f3836b704c2f35f72e4f2d566f40040">tvs_mediaplayer_adapter_is_player_valid</a>) ()</td></tr>
<tr class="memdesc:a9f3836b704c2f35f72e4f2d566f40040"><td class="mdescLeft">&#160;</td><td class="mdescRight">media player是否有效，如果无效，新的智能语音对话无法发起  <a href="#a9f3836b704c2f35f72e4f2d566f40040">更多...</a><br /></td></tr>
<tr class="separator:a9f3836b704c2f35f72e4f2d566f40040"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ed5847f9a32d638e973e2edb8519d52"><td class="memItemLeft" align="right" valign="top">typedef bool(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a8ed5847f9a32d638e973e2edb8519d52">tvs_mediaplayer_adapter_play_tts_inner</a>) ()</td></tr>
<tr class="memdesc:a8ed5847f9a32d638e973e2edb8519d52"><td class="mdescLeft">&#160;</td><td class="mdescRight">是否在SDK内部播放TTS(可选)  <a href="#a8ed5847f9a32d638e973e2edb8519d52">更多...</a><br /></td></tr>
<tr class="separator:a8ed5847f9a32d638e973e2edb8519d52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2baac3e9cf50ea7d23b1fd68b0c516ef"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a2baac3e9cf50ea7d23b1fd68b0c516ef">tvs_mediaplayer_adapter_tts_start</a>) (int type)</td></tr>
<tr class="memdesc:a2baac3e9cf50ea7d23b1fd68b0c516ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">TTS流开始播放，此回调函数被调用，代表SDK已经准备下发TTS数据流，此时需要准备并开启播放器，等待TTS数据写入(可选)  <a href="#a2baac3e9cf50ea7d23b1fd68b0c516ef">更多...</a><br /></td></tr>
<tr class="separator:a2baac3e9cf50ea7d23b1fd68b0c516ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04a6dcef3139375e1673539daff34bb3"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a04a6dcef3139375e1673539daff34bb3">tvs_mediaplayer_adapter_tts_end</a>) (bool force_stop)</td></tr>
<tr class="memdesc:a04a6dcef3139375e1673539daff34bb3"><td class="mdescLeft">&#160;</td><td class="mdescRight">TTS流结束播放(可选)  <a href="#a04a6dcef3139375e1673539daff34bb3">更多...</a><br /></td></tr>
<tr class="separator:a04a6dcef3139375e1673539daff34bb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5425eb4485baffbc77bd7195ca5354af"><td class="memItemLeft" align="right" valign="top">typedef int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a5425eb4485baffbc77bd7195ca5354af">tvs_mediaplayer_adapter_tts_data</a>) (char *data, int data_len)</td></tr>
<tr class="memdesc:a5425eb4485baffbc77bd7195ca5354af"><td class="mdescLeft">&#160;</td><td class="mdescRight">TTS流数据下发(可选)  <a href="#a5425eb4485baffbc77bd7195ca5354af">更多...</a><br /></td></tr>
<tr class="separator:a5425eb4485baffbc77bd7195ca5354af"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a1f6eb9e986aab71e8b4fa06e8a407e33"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a1f6eb9e986aab71e8b4fa06e8a407e33">tvs_mediaplayer_adapter_init</a> (<a class="el" href="structtvs__mediaplayer__adapter.html">tvs_mediaplayer_adapter</a> *adapter)</td></tr>
<tr class="memdesc:a1f6eb9e986aab71e8b4fa06e8a407e33"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化mediaplayer adapter  <a href="#a1f6eb9e986aab71e8b4fa06e8a407e33">更多...</a><br /></td></tr>
<tr class="separator:a1f6eb9e986aab71e8b4fa06e8a407e33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d0159647baaa1bf22ccd4075cfa336a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a8d0159647baaa1bf22ccd4075cfa336a">tvs_mediaplayer_adapter_on_play_finished</a> (const char *token)</td></tr>
<tr class="memdesc:a8d0159647baaa1bf22ccd4075cfa336a"><td class="mdescLeft">&#160;</td><td class="mdescRight">播放腾讯云叮当下发的网络媒体结束的时候，调用此函数通知TVS SDK  <a href="#a8d0159647baaa1bf22ccd4075cfa336a">更多...</a><br /></td></tr>
<tr class="separator:a8d0159647baaa1bf22ccd4075cfa336a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40c43675b6795f92b76bd7228e3083b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a40c43675b6795f92b76bd7228e3083b5">tvs_mediaplayer_adapter_on_play_stopped</a> (int error_code, const char *token)</td></tr>
<tr class="memdesc:a40c43675b6795f92b76bd7228e3083b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">正在播放腾讯云叮当下发的网络媒体的时候，出错或者停止时，调用此函数通知TVS SDK  <a href="#a40c43675b6795f92b76bd7228e3083b5">更多...</a><br /></td></tr>
<tr class="separator:a40c43675b6795f92b76bd7228e3083b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ad34c4377ed0dfb30c5f6167948ff43"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#a6ad34c4377ed0dfb30c5f6167948ff43">tvs_mediaplayer_adapter_on_play_started</a> (const char *token)</td></tr>
<tr class="memdesc:a6ad34c4377ed0dfb30c5f6167948ff43"><td class="mdescLeft">&#160;</td><td class="mdescRight">播放腾讯云叮当下发的网络媒体开始播放的时候，调用此函数通知TVS SDK  <a href="#a6ad34c4377ed0dfb30c5f6167948ff43">更多...</a><br /></td></tr>
<tr class="separator:a6ad34c4377ed0dfb30c5f6167948ff43"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf73484e2cd8af108a51aeb70fe385ab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tvs__media__player__adapter_8h.html#abf73484e2cd8af108a51aeb70fe385ab">tvs_mediaplayer_adapter_on_play_paused</a> (const char *token)</td></tr>
<tr class="memdesc:abf73484e2cd8af108a51aeb70fe385ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">播放腾讯云叮当下发的网络媒体暂停的时候，调用此函数通知TVS SDK  <a href="#abf73484e2cd8af108a51aeb70fe385ab">更多...</a><br /></td></tr>
<tr class="separator:abf73484e2cd8af108a51aeb70fe385ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>TVS 流媒体播放适配接口层 </p>
<dl class="section date"><dt>日期</dt><dd>2019-5-10 </dd></dl>
</div><h2 class="groupheader">类型定义说明</h2>
<a id="a52e20f052ba7d319e1fe54e32d14453d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52e20f052ba7d319e1fe54e32d14453d">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_get_offset</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* tvs_mediaplayer_adapter_get_offset) (const char *token)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取当前播放的网络流媒体的已播放时间 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9f3836b704c2f35f72e4f2d566f40040"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f3836b704c2f35f72e4f2d566f40040">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_is_player_valid</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef bool(* tvs_mediaplayer_adapter_is_player_valid) ()</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>media player是否有效，如果无效，新的智能语音对话无法发起 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af6884e0117cd98dce6be3882426f9cc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af6884e0117cd98dce6be3882426f9cc7">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_pause_play</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* tvs_mediaplayer_adapter_pause_play) (const char *token)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>暂停播放 在终端SDK进入繁忙状态（比如开始输入语音、开始媒体播控等情况下），SDK将回调此接口， 暂停当前播放的流媒体。 实现此接口，调用平台播放器的pause功能，暂停播放当前流媒体，以让出资源供SDK执行对应工作 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a8ed5847f9a32d638e973e2edb8519d52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ed5847f9a32d638e973e2edb8519d52">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_play_tts_inner</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef bool(* tvs_mediaplayer_adapter_play_tts_inner) ()</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>是否在SDK内部播放TTS(可选) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9b66feb55fe6e4b77791adfb7b7cee0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9b66feb55fe6e4b77791adfb7b7cee0a">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_resume_play</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* tvs_mediaplayer_adapter_resume_play) (const char *token)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>继续播放 在终端SDK从繁忙状态进入空闲状态后（比如当前一轮智能语音交互、媒体播控等工作结束），SDK将回调此接口， 继续播放之前下发的流媒体；如果之前终端并未处于播放网络流媒体的状态，则SDK不会回调此接口。 实现此接口，调用平台播放器的resume功能 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9867087019c4f62eea0194df0a248eaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9867087019c4f62eea0194df0a248eaf">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_set_source</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* tvs_mediaplayer_adapter_set_source) (const char *song_url, const char *token, uint32_t offsetInSeconds)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>当用户通过智能语音、媒体播控，或者在APP端推送媒体时，云端将媒体下发到设备端，SDK将回调此接口， 实现此接口，将下发的新媒体的流媒体url，以及媒体对应的唯一标识，和需要快进的进度设置给平台播放器， 准备开始播放</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">song_url</td><td>待播放的流媒体url。 </td></tr>
    <tr><td class="paramname">token</td><td>媒体对应的唯一标识。 </td></tr>
    <tr><td class="paramname">offsetInSeconds</td><td>如果此参数大于0，代表此媒体需要快进到offsetInSeconds秒处，再开始播放 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>0代表成功，其他值代表失败 </dd></dl>

</div>
</div>
<a id="a1dd54fea0aa69746845bc6132ff367a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1dd54fea0aa69746845bc6132ff367a4">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_start_play</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* tvs_mediaplayer_adapter_start_play) (const char *token)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>开始播放 当云端下发了一个新媒体后，SDK将调用此接口。 需要实现此接口，调用平台的播放器，播放之前set_source阶段下发的媒体url </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aeff4493ad02ff9366ed821122b6b588b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeff4493ad02ff9366ed821122b6b588b">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_stop_play</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* tvs_mediaplayer_adapter_stop_play) (const char *token)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>停止播放 当用户通过语音暂停/停止播放（比如通过语音输入“暂停播放”、“停止播放”等指令）， 或者在APP端暂停/停止播放之前下发的媒体的时候，SDK将会调用此接口。 实现此接口，调用平台播放器的stop功能，停止播放之前下发的流媒体 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname"></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a5425eb4485baffbc77bd7195ca5354af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5425eb4485baffbc77bd7195ca5354af">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_tts_data</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* tvs_mediaplayer_adapter_tts_data) (char *data, int data_len)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TTS流数据下发(可选) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>TTS流数据 </td></tr>
    <tr><td class="paramname">data_len</td><td>当前下发的TTS流数据的字节数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="a04a6dcef3139375e1673539daff34bb3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04a6dcef3139375e1673539daff34bb3">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_tts_end</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* tvs_mediaplayer_adapter_tts_end) (bool force_stop)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TTS流结束播放(可选) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">force_stop</td><td>取值true代表强制结束，不管当前是否还有TTS数据未播放完毕 取值false代表此回调需要阻塞等待TTS数据播放完毕后，停止播放器，再返回 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="a2baac3e9cf50ea7d23b1fd68b0c516ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2baac3e9cf50ea7d23b1fd68b0c516ef">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_tts_start</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int(* tvs_mediaplayer_adapter_tts_start) (int type)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TTS流开始播放，此回调函数被调用，代表SDK已经准备下发TTS数据流，此时需要准备并开启播放器，等待TTS数据写入(可选) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>TTS数据类型，1为MP3，其他值保留 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>0代表 </dd></dl>

</div>
</div>
<h2 class="groupheader">函数说明</h2>
<a id="a1f6eb9e986aab71e8b4fa06e8a407e33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f6eb9e986aab71e8b4fa06e8a407e33">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tvs_mediaplayer_adapter_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structtvs__mediaplayer__adapter.html">tvs_mediaplayer_adapter</a> *&#160;</td>
          <td class="paramname"><em>adapter</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化mediaplayer adapter </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">adapter</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="a8d0159647baaa1bf22ccd4075cfa336a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8d0159647baaa1bf22ccd4075cfa336a">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_on_play_finished()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tvs_mediaplayer_adapter_on_play_finished </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>token</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>播放腾讯云叮当下发的网络媒体结束的时候，调用此函数通知TVS SDK </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">token</td><td>网络媒体token </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="abf73484e2cd8af108a51aeb70fe385ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf73484e2cd8af108a51aeb70fe385ab">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_on_play_paused()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tvs_mediaplayer_adapter_on_play_paused </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>token</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>播放腾讯云叮当下发的网络媒体暂停的时候，调用此函数通知TVS SDK </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">token</td><td>网络媒体token </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="a6ad34c4377ed0dfb30c5f6167948ff43"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ad34c4377ed0dfb30c5f6167948ff43">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_on_play_started()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tvs_mediaplayer_adapter_on_play_started </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>token</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>播放腾讯云叮当下发的网络媒体开始播放的时候，调用此函数通知TVS SDK </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">token</td><td>网络媒体token </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="a40c43675b6795f92b76bd7228e3083b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40c43675b6795f92b76bd7228e3083b5">&#9670;&nbsp;</a></span>tvs_mediaplayer_adapter_on_play_stopped()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tvs_mediaplayer_adapter_on_play_stopped </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>error_code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>正在播放腾讯云叮当下发的网络媒体的时候，出错或者停止时，调用此函数通知TVS SDK </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">error_code</td><td>错误码，见TVS_MEDIA_PLAYER_ERROR_* </td></tr>
    <tr><td class="paramname">token</td><td>网络媒体token </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="tvs__media__player__adapter_8h.html">tvs_media_player_adapter.h</a></li>
    <li class="footer">制作者
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
